/*
 * codelogger.h
 *
 *  Created on: 2011-8-19
 *      Author: chenl
 *     Purpose:
 *        Note:
 */

#include "common/protocol.h"
#include "loki/Singleton.h"


class CCodeLogger
{
public:
	CCodeLogger();
	~CCodeLogger();
public:
	void DoPackageLog(const Byte *pszBuf, unsigned int uBUfLen, unsigned int *puOffset);
	void Flush();
protected:
	void DumpPackage(const Byte *pszBuf, unsigned int uBufLen);
private:
	unsigned int m_nBuffOffset;
	Byte m_buf[PACKAGE_HEADER_SIZE];
};

typedef Loki::SingletonHolder<CCodeLogger> CodeLogger;
#define CREATE_CODELOGGER_INSTANCE CodeLogger::INSTANCE
#define GET_CODELOGGER_INSTANCE CodeLogger::INSTANCE
